package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
@JsonIgnoreProperties("handler")
public class FriendDynamics  extends BaseDomain{

    private User user;

    private String dynamicsContent;

    private String dynamicsPictrues;

    private List<TravelComment> comments=new ArrayList<>();

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date creatTime;

    public String[] getImgsArr(){
        return dynamicsPictrues.split(";");
    }
}